# -*- coding: utf-8 -*-
# Django settings for graduation_design project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS
import os, sys
PRO_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), ))
DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'graduation_design'             # Or path to database file if using sqlite3.
DATABASE_USER = 'graduation_desig'             # Not used with sqlite3.
DATABASE_PASSWORD = 'graduation_design'         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Asia/Shanghai'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'zh-CN'

LANGUAGES = (
    ('en', u'English'),
    ('zh-cn', u"简体中文"),
)

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(PRO_PATH, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/admin-media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '=p5=%4nr0gv=eliy=&e807wy7lxy_wxf1^xt$_rvm_h88gwmwg'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.request',
    'graduation_design.main.context_processors.site',
)

ROOT_URLCONF = 'graduation_design.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(PRO_PATH, 'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.comments',
    'doc_trans',
    'debug_toolbar',
    'registration',
    'graduation_design.main',
)

SITE_NAME = u"Collaborative Documentation Translation Platform"
SITE_NAME_CN = u"协同文档翻译平台"
SITE_DOMAIN = u"www.net.cn"

ACCOUNT_ACTIVATION_DAYS = 7

# Host for sending e-mail.
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
# Optional SMTP authentication information for EMAIL_HOST.
EMAIL_HOST_USER = 'hi@paila.net'
EMAIL_HOST_PASSWORD = '123456'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'hi@paila.net'
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME_CN

#INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_panels.sql_unique.SQLUniqueDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
    'debug_toolbar.panels.cache.CacheDebugPanel',
)

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
}

DOCS_DIR = os.path.join(PRO_PATH, 'docs_repository')
ORIGINAL_LANGUAGE = 'en'
TRANSLATION_LANGUAGE = 'zh-cn'
HG_REPO_NAME = 'hg'
WEB_DOCS_DIR = os.path.join(PRO_PATH, 'web_docs_repository')
SVN_DOCS_DIR = os.path.join(PRO_PATH, 'svn_docs_repository')
SVN_DOCS_BACKUP_DIR = os.path.join(PRO_PATH, 'svn_docs_repository_backup')

if os.name == 'nt':
    LOCAL_SVN_URL = 'file:///%s/' % SVN_DOCS_DIR.replace('\\', '/')
else:
    LOCAL_SVN_URL = 'file://%s/' % SVN_DOCS_DIR